from kivy.utils import platform

if platform() == 'android':
    import android


class PlatformAdapter():
    def vibrate(self):
        pass

    def hide_keyboard(self):
        pass

    def show_keyboard(self):
        pass

    @staticmethod
    def get_adapter():
        if platform() == 'android':
            return AndroidAdapter()
        return PlatformAdapter()


class AndroidAdapter(PlatformAdapter):
    def vibrate(self):
        android.vibrate(1)

    def hide_keyboard(self):
        android.hide_keyboard()

    def show_keyboard(self):
        android.show_keyboard()
